package com.creating.mict.common;


import java.util.Map;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

@SuppressWarnings("serial")
public class MyInterceptor implements Interceptor{

	
	public void destroy() {
		
	}

	
	public void init() {
		
	}

	
	public String intercept(ActionInvocation invocation) throws Exception {
		Map sessionMap = invocation.getInvocationContext().getSession();
		String username = (String)sessionMap.get("userName");
		
		if (username != null) {
			return invocation.invoke();
		}
		return "error";
	}

}
